import { ElLoading } from "element-plus";

let loading = null;
export const showLoading = (message) => {
  loading = ElLoading.service({
    lock: true,
    text: message || '数据处理中，请稍候...',
    customClass: 'cc-loading'
  });
};

export const hideLoading = () => {
  if (loading) {
    loading.close();
    loading = null;
  }
};

export default {
  showLoading,
  hideLoading
};